ݱʽִֵһ䡣

If condition Then statements [Else elsestatements ] 
ߣʹÿʽ﷨ 

If condition Then
[statements]
[ElseIf condition-n Then
[elseifstatements]] . . .
[Else
[elsestatements]]
End If 

condition 
һ͵ıʽ 
ֵַʽ True  False condition  Null condition Ϊ False 

 TypeOf objectname Is objecttype ıʽobjectname κζã objecttype κЧĶ͡ objectname  objecttype ָһֶͣʽΪ TrueΪ False 

Statements 
 condition Ϊ True ʱִеһðŷֿ䡣 
condition-n 
ͬ condition 
elseifstatements 
ص condition-n Ϊ Trueʱִеһ䡣 
elsestatements 
ǰû condition  condition-n ʽΪ True ʱִеһ䡣 
˵
ڶС򵥵Ĳԣʹõʽһ﷨ʽڶ﷨ṩ˱ȵʽǿĽṹӦԣȽĶάԡ

ע   ڵ﷨УִжΪ If...Then жϵĽͬһϲðŷֿʾ
If A > 10 Then A = A + 1 : B = B + A : C = C + B
е If 飨ڶ﷨ʱ condition condition  Trueִ Then ֮䡣 condition  Falseÿ ElseIf ֵʽеĻμ㲢ԲԡҵĳΪ True ʱص Then ֮ᱻִСûһ ElseIf  Trueû ElseIf Ӿ䣩ִ Else ֮䡣ִ Then  Else ֮Ժ󣬽ִ End If ֮䡣

Else  ElseIf Ӿ䶼ǿѡġ If пԷ ElseIf Ӿ䣬Ƕ Else Ӿ֮ǰIf ԱǶףһ If ֮С

ҪжĳǷһ If 飬ɼ Then ؼ֮ʲô Then ͬһ֮ע͵ݣǵʽ If 䡣

If ĳһеĵһ䣬ұ End If 

Ҫ
汾 1
